{% extends "base.html" %}     

{% block head %}
    <script src="/js/mootools-release-1.11.js" type="text/javascript"></script>
    <script src="/js/ValidCommentForm.js" type="text/javascript"></script>    
    <script type="text/javascript">
        window.addEvent('domready', function(){
            new CommentFormValidator();
        });    
    </script>
{% endblock %}

{% block content %}   
    <div>
        <h2>{{ article.title }}</h2>
        <i>PostTime:{{ article.post_time }}</i>&nbsp;&nbsp;<i>Category:<a href="/blog/cate/{{ article.category.id }}/">{{ article.category.name }}</a></i>&nbsp;&nbsp;Views:{{ article.view_count }}&nbsp;&nbsp;Comments:{{ article.comm_count }}
        <p>{{ article.content }}</p>
    </div>
    <div>
        {% for comm in comments %}
        <i>{{ comm.post_time|date:"Y-m-d H:i:s" }}</i>&nbsp;&nbsp;<strong>{{ comm.name }} say:</strong>    
        <p>{{ comm.content }}</p>
        {% endfor %}
    </div>
    <div>
        <h3>Post comment:</h3>
        <form method="POST" action="/blog/{{ article.id }}/comment/add/">
            {{ form }}            
            <p><label for="id_captcha">CheckCode:</label><input id="id_captcha" type="text" /><br/><img src="/captcha/" /><p>
            <p><input type="submit" value="Submit"/></p>
        </form>
    </div>
{% endblock %} 